Skip to content

Conversation

steakhal
Copy link
Contributor

The commits were gathered using:

git log --reverse --oneline llvmorg-20-init..llvm/main \
  clang/{lib/StaticAnalyzer,include/clang/StaticAnalyzer} | grep -v NFC | \
  grep -v OpenACC | grep -v -i revert | grep -v -i "webkit"

FYI, I also ignored Webkit changes because I assue it's fairly specific for them, and they likely already know what they ship xD.

I used the LLVM_ENABLE_SPHINX=ON and LLVM_ENABLE_DOXYGEN=ON cmake options to enable the docs-clang-html build target, which generates the html into build/tools/clang/docs/html/ReleaseNotes.html of which I attach the screenshots to let you judge if it looks all good or not.

@steakhal steakhal added this to the LLVM 21.x Release milestone Aug 20, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Aug 20, 2025
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Aug 20, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 20, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Balazs Benics (steakhal)

Changes

The commits were gathered using:

git log --reverse --oneline llvmorg-20-init..llvm/main \
  clang/{lib/StaticAnalyzer,include/clang/StaticAnalyzer} | grep -v NFC | \
  grep -v OpenACC | grep -v -i revert | grep -v -i "webkit"

FYI, I also ignored Webkit changes because I assue it's fairly specific for them, and they likely already know what they ship xD.

I used the LLVM_ENABLE_SPHINX=ON and LLVM_ENABLE_DOXYGEN=ON cmake options to enable the docs-clang-html build target, which generates the html into build/tools/clang/docs/html/ReleaseNotes.html of which I attach the screenshots to let you judge if it looks all good or not.


Full diff: https://github.com/llvm/llvm-project/pull/154600.diff

1 Files Affected:

  • (modified) clang/docs/ReleaseNotes.rst (+85-5)
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index f4f7dd8342d92..a8fd4b174cf7c 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1198,8 +1198,6 @@ Code Completion
 
 Static Analyzer
 ---------------
-- Fixed a crash when C++20 parenthesized initializer lists are used. This issue
-  was causing a crash in clang-tidy. (#GH136041)
 
 New features
 ^^^^^^^^^^^^
@@ -1223,20 +1221,99 @@ New features
 - Implemented `P2719R5 Type-aware allocation and deallocation functions <https://wg21.link/P2719>`_
   as an extension in all C++ language modes.
 
+- Added support for the ``[[clang::assume(cond)]]`` attribute, treating it as
+  ``__builtin_assume(cond)`` for better static analysis. (#GH129234)
+
+- Introduced per-entry-point statistics to provide more detailed analysis metrics.
+  Documentation: :doc:`analyzer/developer-docs/Statistics` (#GH131175)
+
+- Added time-trace scopes for high-level analyzer steps to improve performance
+  debugging. Documentation: :doc:`analyzer/developer-docs/PerformanceInvestigation`
+  (#GH125508, #GH125884)
+
+- Enhanced the ``check::BlockEntrance`` checker callback to provide more granular
+  control over block-level analysis.
+  `Documentation (check::BlockEntrance)
+  <https://clang.llvm.org/doxygen/CheckerDocumentation_8cpp_source.html>`_
+  (#GH140924)
+
+- Added a new experimental checker ``alpha.core.FixedAddressDereference`` to detect
+  dereferences of fixed addresses, which can be useful for finding hard-coded memory
+  accesses. (#GH127191)
 
 Crash and bug fixes
 ^^^^^^^^^^^^^^^^^^^
 
+- Fixed a crash when C++20 parenthesized initializer lists are used.
+  This affected a crash of the well-known lambda overloaded pattern.
+  (#GH136041, #GH135665)
+
+- Dropped an unjustified assertion, that was triggered in ``BugReporterVisitors.cpp``
+  for variable initialization detection. (#GH125044)
+
 - Fixed a crash in ``UnixAPIMisuseChecker`` and ``MallocChecker`` when analyzing
   code with non-standard ``getline`` or ``getdelim`` function signatures. (#GH144884)
 
+- Fixed crashes involving ``__builtin_bit_cast``. (#GH139188)
+
+- ``__datasizeof`` (C++) and ``_Countof`` (C) no longer cause a failed assertion
+  when given an operand of VLA type. (#GH151711)
+
+- Fixed a crash in ``CastSizeChecker``. (#GH134387)
+
+- Some ``cplusplus.PlacementNew`` false positives were fixed. (#GH150161)
+
 Improvements
 ^^^^^^^^^^^^
 
+- Added option to assume at least one iteration in loops to reduce false positives.
+  (#GH125494)
+
 - The checker option ``optin.cplusplus.VirtualCall:PureOnly`` was removed,
-  because it had been deprecated since 2019 and it is completely useless (it
-  was kept only for compatibility with pre-2019 versions, setting it to true is
-  equivalent to completely disabling the checker).
+  because it had been deprecated since 2019. (#GH131823)
+
+- Enhanced the ``StackAddrEscapeChecker`` to detect more cases of stack address
+  escapes, including return values for child stack frames. (#GH126620, #GH126986)
+
+- Improved the ``BlockInCriticalSectionChecker`` to recognize ``O_NONBLOCK``
+  streams and suppress reports in those cases. (#GH127049)
+
+- Better support for lambda-converted function pointers in analysis. (#GH144906)
+
+- Improved modeling of ``getcwd`` function in ``StdCLibraryFunctions`` checker.
+  (#GH141076)
+
+- Enhanced the ``EnumCastOutOfRange`` checker to ignore ``[[clang::flag_enum]]``
+  enums. (#GH141232)
+
+- Improved handling of structured bindings captured by lambdas. (#GH132579, #GH91835)
+
+- Fixed unnamed bitfield handling in ``UninitializedObjectChecker``. (#GH132427, #GH132001)
+
+- Enhanced iterator checker modeling for ``insert`` operations. (#GH132596)
+
+- Improved ``format`` attribute handling in ``GenericTaintChecker``. (#GH132765)
+
+- Added support for ``consteval`` in ``ConditionBRVisitor::VisitTerminator``.
+  (#GH146859, #GH139130)
+
+- Enhanced handling of C standard streams in internal memory space. (#GH147766)
+
+- Enhanced store management with region-store-binding-limit to improve performance.
+  See `region-store-max-binding-fanout
+  <https://clang.llvm.org/docs/analyzer/user-docs/Options.html#region-store-max-binding-fanout>`_
+  config option. Overriding these options are discouraged, unless you know what you do.
+  (#GH127602)
+
+- Updated undefined assignment checker (``core.uninitialized.Assign``) diagnostics
+  to avoid using the term ``garbage``. (#GH126596)
+
+- Fixed false memory leak reports involving placement new. (#GH144341)
+
+- Avoided unnecessary super region invalidation in ``CStringChecker``.
+  (#GH146212, #GH143807)
+
+- Enhanced handling of tainted division-by-zero error paths. (#GH144491)
 
 Moved checkers
 ^^^^^^^^^^^^^^
@@ -1246,6 +1323,9 @@ Moved checkers
   checker ``alpha.security.ArrayBound`` (which was searching for the same kind
   of bugs with an different, simpler and less accurate algorithm) is removed.
 
+- Moved checker ``alpha.core.FixedAddressDereference`` out of the ``alpha`` package
+  to ``core.FixedAddressDereference ``. (#GH132404)
+
 .. _release-notes-sanitizers:
 
 Sanitizers

@steakhal
Copy link
Contributor Author

I had limited time, so I used LLM to generate this. Exercise extra scrutiny during review.

There is an unrelated section about Type-aware allocation and deallocation functions that I'll move somewhere more appropriate later. The generated html would look like this then:
sample

@github-project-automation github-project-automation bot moved this from Needs Triage to Needs Merge in LLVM Release Status Aug 21, 2025
@tru tru moved this from Needs Merge to Needs Review in LLVM Release Status Aug 21, 2025
@Xazax-hun
Copy link
Collaborator

Looks good to me. Are all of those crashes present in previously released stable versions?

@steakhal
Copy link
Contributor Author

Looks good to me. Are all of those crashes present in previously released stable versions?

To the best of knowledge yes. I also checked that no entries refer to commits that are only present on main.
(Well, there were two, that are now in the backport pipe)
I also excluded new feature crashes, such as the assume handling crashes, because that's new feature; thus it was never released.

You can spotcheck this though.

@steakhal
Copy link
Contributor Author

This PR is blocked by #154608

@NagyDonat
Copy link
Contributor

Do I understand that this document is primarily intended for the users of the static analyzer? In that case I think it would be important to use the user-facing names of the checkers that are mentioned (e.g. write unix.BlockInCriticalSection instead of BlockInCriticalSectionChecker).

(I'm willing to implement this change if you agree that it's beneficial.)

@steakhal
Copy link
Contributor Author

steakhal commented Aug 25, 2025

Do I understand that this document is primarily intended for the users of the static analyzer? In that case I think it would be important to use the user-facing names of the checkers that are mentioned (e.g. write unix.BlockInCriticalSection instead of BlockInCriticalSectionChecker).

(I'm willing to implement this change if you agree that it's beneficial.)

Please do @NagyDonat . The release notes are primarily for end users, and a tiny bit also for vendors, like CodeChecker or anyone packaging it in some product.

@steakhal
Copy link
Contributor Author

Do I understand that this document is primarily intended for the users of the static analyzer? In that case I think it would be important to use the user-facing names of the checkers that are mentioned (e.g. write unix.BlockInCriticalSection instead of BlockInCriticalSectionChecker).
(I'm willing to implement this change if you agree that it's beneficial.)

Please do @NagyDonat . The release notes are primarily for end users, and a tiny bit also for vendors, like CodeChecker or anyone packaging it in some product.

Fixed in 2068466

@steakhal
Copy link
Contributor Author

@tru This PR is ready to merge.

@NagyDonat
Copy link
Contributor

Do I understand that this document is primarily intended for the users of the static analyzer? In that case I think it would be important to use the user-facing names of the checkers that are mentioned (e.g. write unix.BlockInCriticalSection instead of BlockInCriticalSectionChecker).
(I'm willing to implement this change if you agree that it's beneficial.)

Please do @NagyDonat . The release notes are primarily for end users, and a tiny bit also for vendors, like CodeChecker or anyone packaging it in some product.

Fixed in 2068466

Thanks for doing this! I wanted to do this just now, but you were faster than me...

@tru tru force-pushed the bb/update-csa-release-notes branch from 2068466 to b81295e Compare August 26, 2025 12:06
@tru
Copy link
Collaborator

tru commented Aug 26, 2025

@steakhal before I merge - have a look, I squashed it and had to fix some issues. But I think it's fine now, let me know otherwise.

For future reference, when updating a branch for the release branch we can't use the automatic squash and rebase workflow of github, so it's better if you squash and rebase yourself otherwise I will have to do that manually.

The commits were gathered using:
```sh
git log --reverse --oneline llvmorg-20-init..llvm/main \
  clang/{lib/StaticAnalyzer,include/clang/StaticAnalyzer} | grep -v NFC | \
  grep -v OpenACC | grep -v -i revert | grep -v -i "webkit"
```

FYI, I also ignored Webkit changes because I assue it's fairly specific
for them, and they likely already know what they ship xD.

I used the `LLVM_ENABLE_SPHINX=ON` and `LLVM_ENABLE_DOXYGEN=ON` cmake
options to enable the `docs-clang-html` build target, which generates
the html into `build/tools/clang/docs/html/ReleaseNotes.html` of which I
attach the screenshots to let you judge if it looks all good or not.
@steakhal steakhal force-pushed the bb/update-csa-release-notes branch from b81295e to 3e406bb Compare August 26, 2025 12:11
@steakhal
Copy link
Contributor Author

@steakhal before I merge - have a look, I squashed it and had to fix some issues. But I think it's fine now, let me know otherwise.

For future reference, when updating a branch for the release branch we can't use the automatic squash and rebase workflow of github, so it's better if you squash and rebase yourself otherwise I will have to do that manually.

Noted. I checked, and fixed the proposed commit. It's ready for merge. Thanks @tru.

@tru tru merged commit 3e406bb into llvm:release/21.x Aug 26, 2025
12 of 13 checks passed
@github-project-automation github-project-automation bot moved this from Needs Merge to Done in LLVM Release Status Aug 26, 2025
Copy link

@steakhal (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

@tru
Copy link
Collaborator

tru commented Aug 26, 2025

Thanks for the help - it's now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:static analyzer clang Clang issues not falling into any other category
Projects
Development

Successfully merging this pull request may close these issues.

7 participants